package com.crazy.base.starter.mybatisplus.injector;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.crazy.base.starter.mybatisplus.injector.method.BatchInsert;
import org.apache.ibatis.session.Configuration;

import java.util.List;

public class BaseSqlInjector extends DefaultSqlInjector {

    /**
     * <p>
     * 获取 注入的方法
     * </p>
     *
     * @param mapperClass 当前mapper
     * @return 注入的方法集合
     * @since 3.1.2 add  mapperClass
     */
    @Override
    public List<AbstractMethod> getMethodList(Configuration configuration, Class<?> mapperClass, TableInfo tableInfo) {
        //保留原有的方法
        List<AbstractMethod> methodList = super.getMethodList(configuration,mapperClass, tableInfo);
        methodList.add(new BatchInsert());
        return methodList;
    }
}
